package edu.wy.controller;

import edu.wy.common.result.Result;
import edu.wy.service.EventInformationService;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;



/**
 * (EventInformation)表控制层
 *
 * @author makejava
 * @since 2025-04-24 16:42:29
 */
@RestController
@RequestMapping("eventInformation")
public class EventInformationController {

    @Resource
    private EventInformationService eventInformationService;

    /**
     * 根据用户id获取全部信息
     */

    @ApiResponse(description = "根据用户id获取全部信息")
    @GetMapping("/list/{userId}")
    public Result list(@PathVariable("userId") Integer userId){
        return eventInformationService.listByUserId(userId);
    }

    /**
     * 根据日期获取当天信息
     */
    @ApiResponse(description = "根据日期获取当天信息")
    @GetMapping("/listByDay/{userId}")
    public Result listByDay(@PathVariable("userId") Integer userId){
        return eventInformationService.listByDate(userId);
    }

    /**
     * 根据日期获取当月信息
     * @param userId
     * @return 实例对象
     */
    @ApiResponse(description = "根据日期获取当月信息")
    @GetMapping("/listByMonth/{userId}")
    public Result listByMonth(@PathVariable("userId") Integer userId){
        return eventInformationService.listByMonth(userId);
    }

    @ApiResponse(description = "根据日期获取本周信息")
    @GetMapping("/listByWeek/{userId}")
    public Result listByWeek(@PathVariable("userId") Integer userId){
        return eventInformationService.listByWeek(userId);
    }
}

